﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CanSWAT.SWAT
{
    /// <summary>
    /// base class for any file based class
    /// </summary>
    class SWATFile : ArcSWAT.BaseWithProcess
    {
        private string _file = "";

        public string File
        {
            get
            {
                return _file;
            }
        }

        public SWATFile(string file)
        {
            _file = file;
        }

        public virtual bool IsValid
        {
            get
            {
                return System.IO.File.Exists(_file);
            }
        }

        /// <summary>
        /// just open the corresponding text file. A edit window could be added in the future.
        /// </summary>
        public virtual void Edit()
        {
            if (IsValid)
                System.Diagnostics.Process.Start(File);
            else
                CanSWAT.showInformationWindow(File + " doesn't exist.");
        }  
    }
}
